home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
dev
/
e
/
amigae21b.lha
/
Amiga_E_v2.1b
/
Sources
/
Examples
/
Public.e
< prev
next >
Wrap
Text File
|
1992-09-02
|
1KB
|
39 lines
/* Opening our public screen with a shell on it ...
note: this example does not handle two screens with the
same name, nor other fancy things... */
OPT OSVERSION=37
MODULE 'intuition/screens'
ENUM OKAY,NOSCREEN,NOSIG
PROC main() HANDLE
DEF s=NIL,sig=-1,name
IF (s:=OpenScreenTagList(0, /* get ourselves a public screen */
[SA_DEPTH,2,
SA_DISPLAYID,$8000,
SA_PUBNAME,name:='PublicShell',
SA_TITLE,name,
SA_PUBSIG,IF (sig:=AllocSignal(-1))=NIL THEN Raise(NOSIG) ELSE sig,
SA_PUBTASK,NIL,
0,0]))=NIL THEN Raise(NOSCREEN)
PubScreenStatus(s,0) /* make it available */
SetDefaultPubScreen(name)
SetPubScreenModes(SHANGHAI)
Execute('NewShell WINDOW CON:0/0/640/256/bla/NOBORDER/BACKDROP',NIL,NIL)
/* other applications can use our screen also.
if we just want our shell on it, turn it private again */
Wait(Shl(1,sig)) /* wait until all windows closed */
SetDefaultPubScreen(NIL) /* workbench is default again */
Raise(OKAY)
EXCEPT
IF s THEN CloseS(s)
IF sig>=0 THEN FreeSignal(sig)
IF exception=NOSCREEN
WriteF('Could not open screen!\n')
ELSEIF exception=NOSIG
WriteF('No signal available!\n')
ENDIF
ENDPROC